#include "rvfft.hpp"
#include "instr_printer.hpp"

#define PRINT(instruction)  \
printer.add_instr(rvfft::instruction)

int main()
{
    InstrPrinter printer("test.S");
    //layer == 1
    PRINT(complex_mul<0>(0b0,0x0));
    PRINT(complex_mul<0>(0b0,0x1));
    PRINT(complex_mul<0>(0b0,0x2));
    PRINT(complex_mul<0>(0b0,0x3));
    PRINT(complex_mul<0>(0b0,0x4));
    PRINT(complex_mul<0>(0b0,0x5));
    PRINT(complex_mul<0>(0b0,0x6));
    PRINT(complex_mul<0>(0b0,0x7));
    PRINT(complex_mul<0>(0b0,0x8));
    PRINT(complex_mul<0>(0b0,0x9));
    PRINT(complex_mul<0>(0b0,0xa));
    PRINT(complex_mul<0>(0b0,0xb));
    PRINT(complex_mul<0>(0b0,0xc));
    PRINT(complex_mul<0>(0b0,0xd));
    PRINT(complex_mul<0>(0b0,0xe));
    PRINT(complex_mul<0>(0b0,0xf));
    PRINT(complex_mul<0>(0b0,0x10));
    PRINT(complex_mul<0>(0b0,0x11));
    PRINT(complex_mul<0>(0b0,0x12));
    PRINT(complex_mul<0>(0b0,0x13));
    PRINT(complex_mul<0>(0b0,0x14));
    PRINT(complex_mul<0>(0b0,0x15));
    PRINT(complex_mul<0>(0b0,0x16));
    PRINT(complex_mul<0>(0b0,0x17));
    PRINT(complex_mul<0>(0b0,0x18));
    PRINT(complex_mul<0>(0b0,0x19));
    PRINT(complex_mul<0>(0b0,0x1a));
    PRINT(complex_mul<0>(0b0,0x1b));
    PRINT(complex_mul<0>(0b0,0x1c));
    PRINT(complex_mul<0>(0b0,0x1d));
    PRINT(complex_mul<0>(0b0,0x1e));
    PRINT(complex_mul<0>(0b0,0x1f));

    PRINT(butterfly_single<0>(0x0));
    PRINT(butterfly_single<0>(0x1));
    PRINT(butterfly_single<0>(0x2));
    PRINT(butterfly_single<0>(0x3));
    PRINT(butterfly_single<0>(0x4));
    PRINT(butterfly_single<0>(0x5));
    PRINT(butterfly_single<0>(0x6));
    PRINT(butterfly_single<0>(0x7));
    PRINT(butterfly_single<0>(0x8));
    PRINT(butterfly_single<0>(0x9));
    PRINT(butterfly_single<0>(0xa));
    PRINT(butterfly_single<0>(0xb));
    PRINT(butterfly_single<0>(0xc));
    PRINT(butterfly_single<0>(0xd));
    PRINT(butterfly_single<0>(0xe));
    PRINT(butterfly_single<0>(0xf));
    PRINT(butterfly_single<0>(0x10));
    PRINT(butterfly_single<0>(0x11));
    PRINT(butterfly_single<0>(0x12));
    PRINT(butterfly_single<0>(0x13));
    PRINT(butterfly_single<0>(0x14));
    PRINT(butterfly_single<0>(0x15));
    PRINT(butterfly_single<0>(0x16));
    PRINT(butterfly_single<0>(0x17));
    PRINT(butterfly_single<0>(0x18));
    PRINT(butterfly_single<0>(0x19));
    PRINT(butterfly_single<0>(0x1a));
    PRINT(butterfly_single<0>(0x1b));
    PRINT(butterfly_single<0>(0x1c));
    PRINT(butterfly_single<0>(0x1d));
    PRINT(butterfly_single<0>(0x1e));
    PRINT(butterfly_single<0>(0x1f));
   
   // layer == 2 
    PRINT(complex_mul<1>(0b0,0x0));
    PRINT(complex_mul<1>(0b0,0x1));
    PRINT(complex_mul<1>(0b0,0x2));
    PRINT(complex_mul<1>(0b0,0x3));
    PRINT(complex_mul<1>(0b0,0x4));
    PRINT(complex_mul<1>(0b0,0x5));
    PRINT(complex_mul<1>(0b0,0x6));
    PRINT(complex_mul<1>(0b0,0x7));
    PRINT(complex_mul<1>(0b0,0x8));
    PRINT(complex_mul<1>(0b0,0x9));
    PRINT(complex_mul<1>(0b0,0xa));
    PRINT(complex_mul<1>(0b0,0xb));
    PRINT(complex_mul<1>(0b0,0xc));
    PRINT(complex_mul<1>(0b0,0xd));
    PRINT(complex_mul<1>(0b0,0xe));
    PRINT(complex_mul<1>(0b0,0xf));
    PRINT(complex_mul<1>(0b0,0x10));
    PRINT(complex_mul<1>(0b0,0x11));
    PRINT(complex_mul<1>(0b0,0x12));
    PRINT(complex_mul<1>(0b0,0x13));
    PRINT(complex_mul<1>(0b0,0x14));
    PRINT(complex_mul<1>(0b0,0x15));
    PRINT(complex_mul<1>(0b0,0x16));
    PRINT(complex_mul<1>(0b0,0x17));
    PRINT(complex_mul<1>(0b0,0x18));
    PRINT(complex_mul<1>(0b0,0x19));
    PRINT(complex_mul<1>(0b0,0x1a));
    PRINT(complex_mul<1>(0b0,0x1b));
    PRINT(complex_mul<1>(0b0,0x1c));
    PRINT(complex_mul<1>(0b0,0x1d));
    PRINT(complex_mul<1>(0b0,0x1e));
    PRINT(complex_mul<1>(0b0,0x1f));

    PRINT(butterfly_single<1>(0x0));
    PRINT(butterfly_single<1>(0x1));
    PRINT(butterfly_single<1>(0x2));
    PRINT(butterfly_single<1>(0x3));
    PRINT(butterfly_single<1>(0x4));
    PRINT(butterfly_single<1>(0x5));
    PRINT(butterfly_single<1>(0x6));
    PRINT(butterfly_single<1>(0x7));
    PRINT(butterfly_single<1>(0x8));
    PRINT(butterfly_single<1>(0x9));
    PRINT(butterfly_single<1>(0xa));
    PRINT(butterfly_single<1>(0xb));
    PRINT(butterfly_single<1>(0xc));
    PRINT(butterfly_single<1>(0xd));
    PRINT(butterfly_single<1>(0xe));
    PRINT(butterfly_single<1>(0xf));
    PRINT(butterfly_single<1>(0x10));
    PRINT(butterfly_single<1>(0x11));
    PRINT(butterfly_single<1>(0x12));
    PRINT(butterfly_single<1>(0x13));
    PRINT(butterfly_single<1>(0x14));
    PRINT(butterfly_single<1>(0x15));
    PRINT(butterfly_single<1>(0x16));
    PRINT(butterfly_single<1>(0x17));
    PRINT(butterfly_single<1>(0x18));
    PRINT(butterfly_single<1>(0x19));
    PRINT(butterfly_single<1>(0x1a));
    PRINT(butterfly_single<1>(0x1b));
    PRINT(butterfly_single<1>(0x1c));
    PRINT(butterfly_single<1>(0x1d));
    PRINT(butterfly_single<1>(0x1e));
    PRINT(butterfly_single<1>(0x1f));


  //layer == 3
    PRINT(complex_mul<2>(0b0,0x0));
    PRINT(complex_mul<2>(0b0,0x1));
    PRINT(complex_mul<2>(0b0,0x2));
    PRINT(complex_mul<2>(0b0,0x3));
    PRINT(complex_mul<2>(0b0,0x4));
    PRINT(complex_mul<2>(0b0,0x5));
    PRINT(complex_mul<2>(0b0,0x6));
    PRINT(complex_mul<2>(0b0,0x7));
    PRINT(complex_mul<2>(0b0,0x8));
    PRINT(complex_mul<2>(0b0,0x9));
    PRINT(complex_mul<2>(0b0,0xa));
    PRINT(complex_mul<2>(0b0,0xb));
    PRINT(complex_mul<2>(0b0,0xc));
    PRINT(complex_mul<2>(0b0,0xd));
    PRINT(complex_mul<2>(0b0,0xe));
    PRINT(complex_mul<2>(0b0,0xf));

    PRINT(butterfly_double(0x0,0x1));
    PRINT(write_buffer(0x1));
    PRINT(butterfly_double(0x2,0x3));
    PRINT(write_buffer(0x3));
    PRINT(butterfly_double(0x4,0x5));
    PRINT(write_buffer(0x5));
    PRINT(butterfly_double(0x6,0x7));
    PRINT(write_buffer(0x7));
    PRINT(butterfly_double(0x8,0x9));
    PRINT(write_buffer(0x9));
    PRINT(butterfly_double(0xa,0xb));
    PRINT(write_buffer(0xb));
    PRINT(butterfly_double(0xc,0xd));
    PRINT(write_buffer(0xd));
    PRINT(butterfly_double(0xe,0xf));
    PRINT(write_buffer(0xf));
    PRINT(butterfly_double(0x10,0x11));
    PRINT(write_buffer(0x11));
    PRINT(butterfly_double(0x12,0x13));
    PRINT(write_buffer(0x13));
    PRINT(butterfly_double(0x14,0x15));
    PRINT(write_buffer(0x15));
    PRINT(butterfly_double(0x16,0x17));
    PRINT(write_buffer(0x17));
    PRINT(butterfly_double(0x18,0x19));
    PRINT(write_buffer(0x19));
    PRINT(butterfly_double(0x1a,0x1b));
    PRINT(write_buffer(0x1b));
    PRINT(butterfly_double(0x1c,0x1d));
    PRINT(write_buffer(0x1d));
    PRINT(butterfly_double(0x1e,0x1f));
    PRINT(write_buffer(0x1f));

      //layer == 4
    PRINT(complex_mul<2>(0b0,0x0));
    PRINT(complex_mul<2>(0b0,0x1));
    PRINT(complex_mul<2>(0b0,0x2));
    PRINT(complex_mul<2>(0b0,0x3));
    PRINT(complex_mul<2>(0b0,0x4));
    PRINT(complex_mul<2>(0b0,0x5));
    PRINT(complex_mul<2>(0b0,0x6));
    PRINT(complex_mul<2>(0b0,0x7));
    PRINT(complex_mul<2>(0b0,0x8));
    PRINT(complex_mul<2>(0b0,0x9));
    PRINT(complex_mul<2>(0b0,0xa));
    PRINT(complex_mul<2>(0b0,0xb));
    PRINT(complex_mul<2>(0b0,0xc));
    PRINT(complex_mul<2>(0b0,0xd));
    PRINT(complex_mul<2>(0b0,0xe));
    PRINT(complex_mul<2>(0b0,0xf));

    PRINT(butterfly_double(0x0,0x1));
    PRINT(write_buffer(0x1));
    PRINT(butterfly_double(0x2,0x3));
    PRINT(write_buffer(0x3));
    PRINT(butterfly_double(0x4,0x5));
    PRINT(write_buffer(0x5));
    PRINT(butterfly_double(0x6,0x7));
    PRINT(write_buffer(0x7));
    PRINT(butterfly_double(0x8,0x9));
    PRINT(write_buffer(0x9));
    PRINT(butterfly_double(0xa,0xb));
    PRINT(write_buffer(0xb));
    PRINT(butterfly_double(0xc,0xd));
    PRINT(write_buffer(0xd));
    PRINT(butterfly_double(0xe,0xf));
    PRINT(write_buffer(0xf));
    PRINT(butterfly_double(0x10,0x11));
    PRINT(write_buffer(0x11));
    PRINT(butterfly_double(0x12,0x13));
    PRINT(write_buffer(0x13));
    PRINT(butterfly_double(0x14,0x15));
    PRINT(write_buffer(0x15));
    PRINT(butterfly_double(0x16,0x17));
    PRINT(write_buffer(0x17));
    PRINT(butterfly_double(0x18,0x19));
    PRINT(write_buffer(0x19));
    PRINT(butterfly_double(0x1a,0x1b));
    PRINT(write_buffer(0x1b));
    PRINT(butterfly_double(0x1c,0x1d));
    PRINT(write_buffer(0x1d));
    PRINT(butterfly_double(0x1e,0x1f));
    PRINT(write_buffer(0x1f));

  //layer == 5
    PRINT(complex_mul<2>(0b0,0x0));
    PRINT(complex_mul<2>(0b0,0x1));
    PRINT(complex_mul<2>(0b0,0x2));
    PRINT(complex_mul<2>(0b0,0x3));
    PRINT(complex_mul<2>(0b0,0x4));
    PRINT(complex_mul<2>(0b0,0x5));
    PRINT(complex_mul<2>(0b0,0x6));
    PRINT(complex_mul<2>(0b0,0x7));
    PRINT(complex_mul<2>(0b0,0x8));
    PRINT(complex_mul<2>(0b0,0x9));
    PRINT(complex_mul<2>(0b0,0xa));
    PRINT(complex_mul<2>(0b0,0xb));
    PRINT(complex_mul<2>(0b0,0xc));
    PRINT(complex_mul<2>(0b0,0xd));
    PRINT(complex_mul<2>(0b0,0xe));
    PRINT(complex_mul<2>(0b0,0xf));

    PRINT(butterfly_double(0x0,0x1));
    PRINT(write_buffer(0x1));
    PRINT(butterfly_double(0x2,0x3));
    PRINT(write_buffer(0x3));
    PRINT(butterfly_double(0x4,0x5));
    PRINT(write_buffer(0x5));
    PRINT(butterfly_double(0x6,0x7));
    PRINT(write_buffer(0x7));
    PRINT(butterfly_double(0x8,0x9));
    PRINT(write_buffer(0x9));
    PRINT(butterfly_double(0xa,0xb));
    PRINT(write_buffer(0xb));
    PRINT(butterfly_double(0xc,0xd));
    PRINT(write_buffer(0xd));
    PRINT(butterfly_double(0xe,0xf));
    PRINT(write_buffer(0xf));
    PRINT(butterfly_double(0x10,0x11));
    PRINT(write_buffer(0x11));
    PRINT(butterfly_double(0x12,0x13));
    PRINT(write_buffer(0x13));
    PRINT(butterfly_double(0x14,0x15));
    PRINT(write_buffer(0x15));
    PRINT(butterfly_double(0x16,0x17));
    PRINT(write_buffer(0x17));
    PRINT(butterfly_double(0x18,0x19));
    PRINT(write_buffer(0x19));
    PRINT(butterfly_double(0x1a,0x1b));
    PRINT(write_buffer(0x1b));
    PRINT(butterfly_double(0x1c,0x1d));
    PRINT(write_buffer(0x1d));
    PRINT(butterfly_double(0x1e,0x1f));
    PRINT(write_buffer(0x1f));

      //layer == 6
    PRINT(complex_mul<2>(0b0,0x0));
    PRINT(complex_mul<2>(0b0,0x1));
    PRINT(complex_mul<2>(0b0,0x2));
    PRINT(complex_mul<2>(0b0,0x3));
    PRINT(complex_mul<2>(0b0,0x4));
    PRINT(complex_mul<2>(0b0,0x5));
    PRINT(complex_mul<2>(0b0,0x6));
    PRINT(complex_mul<2>(0b0,0x7));
    PRINT(complex_mul<2>(0b0,0x8));
    PRINT(complex_mul<2>(0b0,0x9));
    PRINT(complex_mul<2>(0b0,0xa));
    PRINT(complex_mul<2>(0b0,0xb));
    PRINT(complex_mul<2>(0b0,0xc));
    PRINT(complex_mul<2>(0b0,0xd));
    PRINT(complex_mul<2>(0b0,0xe));
    PRINT(complex_mul<2>(0b0,0xf));

    PRINT(butterfly_double(0x0,0x1));
    PRINT(write_buffer(0x1));
    PRINT(butterfly_double(0x2,0x3));
    PRINT(write_buffer(0x3));
    PRINT(butterfly_double(0x4,0x5));
    PRINT(write_buffer(0x5));
    PRINT(butterfly_double(0x6,0x7));
    PRINT(write_buffer(0x7));
    PRINT(butterfly_double(0x8,0x9));
    PRINT(write_buffer(0x9));
    PRINT(butterfly_double(0xa,0xb));
    PRINT(write_buffer(0xb));
    PRINT(butterfly_double(0xc,0xd));
    PRINT(write_buffer(0xd));
    PRINT(butterfly_double(0xe,0xf));
    PRINT(write_buffer(0xf));
    PRINT(butterfly_double(0x10,0x11));
    PRINT(write_buffer(0x11));
    PRINT(butterfly_double(0x12,0x13));
    PRINT(write_buffer(0x13));
    PRINT(butterfly_double(0x14,0x15));
    PRINT(write_buffer(0x15));
    PRINT(butterfly_double(0x16,0x17));
    PRINT(write_buffer(0x17));
    PRINT(butterfly_double(0x18,0x19));
    PRINT(write_buffer(0x19));
    PRINT(butterfly_double(0x1a,0x1b));
    PRINT(write_buffer(0x1b));
    PRINT(butterfly_double(0x1c,0x1d));
    PRINT(write_buffer(0x1d));
    PRINT(butterfly_double(0x1e,0x1f));
    PRINT(write_buffer(0x1f));

    //layer == 7
    PRINT(complex_mul<2>(0b0,0x0));
    PRINT(complex_mul<2>(0b0,0x1));
    PRINT(complex_mul<2>(0b0,0x2));
    PRINT(complex_mul<2>(0b0,0x3));
    PRINT(complex_mul<2>(0b0,0x4));
    PRINT(complex_mul<2>(0b0,0x5));
    PRINT(complex_mul<2>(0b0,0x6));
    PRINT(complex_mul<2>(0b0,0x7));
    PRINT(complex_mul<2>(0b0,0x8));
    PRINT(complex_mul<2>(0b0,0x9));
    PRINT(complex_mul<2>(0b0,0xa));
    PRINT(complex_mul<2>(0b0,0xb));
    PRINT(complex_mul<2>(0b0,0xc));
    PRINT(complex_mul<2>(0b0,0xd));
    PRINT(complex_mul<2>(0b0,0xe));
    PRINT(complex_mul<2>(0b0,0xf));

    PRINT(butterfly_double(0x0,0x1));
    PRINT(write_buffer(0x1));
    PRINT(butterfly_double(0x2,0x3));
    PRINT(write_buffer(0x3));
    PRINT(butterfly_double(0x4,0x5));
    PRINT(write_buffer(0x5));
    PRINT(butterfly_double(0x6,0x7));
    PRINT(write_buffer(0x7));
    PRINT(butterfly_double(0x8,0x9));
    PRINT(write_buffer(0x9));
    PRINT(butterfly_double(0xa,0xb));
    PRINT(write_buffer(0xb));
    PRINT(butterfly_double(0xc,0xd));
    PRINT(write_buffer(0xd));
    PRINT(butterfly_double(0xe,0xf));
    PRINT(write_buffer(0xf));
    PRINT(butterfly_double(0x10,0x11));
    PRINT(write_buffer(0x11));
    PRINT(butterfly_double(0x12,0x13));
    PRINT(write_buffer(0x13));
    PRINT(butterfly_double(0x14,0x15));
    PRINT(write_buffer(0x15));
    PRINT(butterfly_double(0x16,0x17));
    PRINT(write_buffer(0x17));
    PRINT(butterfly_double(0x18,0x19));
    PRINT(write_buffer(0x19));
    PRINT(butterfly_double(0x1a,0x1b));
    PRINT(write_buffer(0x1b));
    PRINT(butterfly_double(0x1c,0x1d));
    PRINT(write_buffer(0x1d));
    PRINT(butterfly_double(0x1e,0x1f));
    PRINT(write_buffer(0x1f));
    return 0;
}